<?php
include("function.php");
global $etypeid;
mssql_select_db($mssql_database, $conn);
$Vchcode = $_POST['id'];
$val = $_POST['value'];
$val =iconv ( 'utf-8', 'GBK', $val);
$val = htmlspecialchars($val, ENT_QUOTES);
if ($field == "note") {
    if (strlen($val) > 100) {
        echo "您输入的字符大于100字了";
        exit;
    }
}
$sql="select etypeid from employee where efullname='$val'";
$querye = mssql_query($sql);
while ( $rst = mssql_fetch_assoc ( $querye ) ){
	$etypeid=$rst['etypeid'];	
}
$query = mssql_query("update dzxt set efullname='$val',etypeid='$etypeid' where Vchcode='$Vchcode';
		update Dlyndx set etypeid='$etypeid' where Vchcode='$Vchcode'");
    if ($query) {
    	$val =iconv ( 'GBK', 'utf-8', $val);
        echo $val;
    } else {
        echo "数据出错";
    }

?>